<?php

namespace addons\workorder\model;

use think\Model;
use traits\model\SoftDelete;

/**
 * 知识库
 */
class Kbs extends Model
{
    use SoftDelete;

    // 表名
    protected $name = 'workorder_kbs';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = 'deletetime';

    protected $append = [
        'createtime_text'
    ];

    public function getCreatetimeTextAttr($value, $data)
    {
        return human_date($data['createtime']);
    }
}